package br.juros.app;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;



public class CalculoParcelas extends Activity {
	
	public double pmt;
	public double icompleto;
	public double vp;
	public double taxajuros;
	public String NumeroParc;
	public String VP;
	public String TaxaJuros;
	public int nm;
	public String Icompleto;
	public String NumeroMeses;
	
	public TextView Parcelas,NomeParcelas,ValorResidual,Amortizacao,Juros,Parc,ValorParc,ValJuros,ValAmort,ValRes;
	
	public LinearLayout layout = new LinearLayout(this);
	public LinearLayout layout1 = new LinearLayout(this);
	public LinearLayout layout2 = new LinearLayout(this);
	public LinearLayout layout3 = new LinearLayout(this);
	public LinearLayout layout4 = new LinearLayout(this);
	public LinearLayout layout5 = new LinearLayout(this);
	
	
	

	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		
		
		layout.setOrientation(LinearLayout.HORIZONTAL);
		layout1.setOrientation(LinearLayout.VERTICAL);
		layout2.setOrientation(LinearLayout.VERTICAL);
		layout3.setOrientation(LinearLayout.VERTICAL);
		layout4.setOrientation(LinearLayout.VERTICAL);
		layout5.setOrientation(LinearLayout.VERTICAL);
		
		ScrollView scroll = new ScrollView(this);
		scroll.setVerticalScrollBarEnabled(true);
		scroll.setScrollbarFadingEnabled(true);
		scroll.addView(layout);

		NumeroMeses = TabCalculo.Parc.toString();

		nm = Integer.parseInt(NumeroMeses);

		NomeParcelas = new TextView(this);
		NomeParcelas.setText("Parc. ");
		layout1.addView(NomeParcelas);

		ValorResidual = new TextView(this);
		ValorResidual.setText("Val Resid. ");
		layout2.addView(ValorResidual);

		Amortizacao = new TextView(this);
		Amortizacao.setText("Amortização ");
		layout3.addView(Amortizacao);

		Juros = new TextView(this);
		Juros.setText("Juros  ");
		layout4.addView(Juros);

		Parc = new TextView(this);
		Parc.setText("Valor Parc. ");
		layout5.addView(Parc);

		NumeroParc = TabCalculo.Pmt.toString();
		pmt = Double.parseDouble(NumeroParc);
		NumeroParc = NumeroParc.substring(0, 8);

		Icompleto = (String) TabCalculo.Icompleto;
		icompleto = Double.parseDouble(Icompleto);

		VP = TabCalculo.VP.toString();
		vp = Double.parseDouble(VP);

		TaxaJuros = TabCalculo.TaxaJuros1.toString();
		taxajuros = Double.parseDouble(TaxaJuros);

		for (int i = 1; i <= nm; i++) {

			Parcelas = new TextView(this);
			Parcelas.setText("" + i);
			layout1.addView(Parcelas);

			ValorParc = new TextView(this);
			ValorParc.setText(" " + NumeroParc);
			layout5.addView(ValorParc);

		}

		double SomaTotalParcelas;
		SomaTotalParcelas = nm * pmt;
		ValorParc = new TextView(this);
		String MostraTotalParcelas = Double.toString(SomaTotalParcelas);
		MostraTotalParcelas = MostraTotalParcelas.substring(0, 8);
		ValorParc.setText(" " + MostraTotalParcelas);
		layout5.addView(ValorParc);
		
		
		

		if (nm == 1) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 2) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 3) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);
		}

		if (nm == 4) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 5) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" "+MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 6) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText("  0,00");
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout2.addView(ValRes);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 7) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);
			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);
			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 8) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);
			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);
			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);
			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);
			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 9) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);
			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);
			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);
			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);
			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);
			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);
			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 10) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);
			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);
			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);
			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);
			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);
			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);
			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);
			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);
			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
		
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 11) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);
			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);
			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);
			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);
			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);
			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);
			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);
			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);
			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);
			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);
			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);
			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);
			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);
			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);
			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);
			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);
			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);
			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);
			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);
			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);
			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);
			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);
			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);
			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);
		
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);

		}

		if (nm == 12) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);


			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}
		if (nm == 13) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);


			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 14) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 15) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 16) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 17) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 18) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

		
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 19) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 20) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

		

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 21) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText(" " + MostraRes19);
			layout2.addView(ValRes);

			double ResJuros19 = ResultValRes19 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros19 = Double.toString(ResJuros18);
			MostraJuros19 = MostraJuros19.substring(0, 5);
			ValJuros.setText("" + MostraJuros19);
			layout4.addView(ValJuros);

			double ResultValAmort20 = pmt - ResJuros19;
			String MostraAmort20 = Double.toString(ResultValAmort20);
			MostraAmort20 = MostraAmort20.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort20);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes20 = ResultValRes19 - ResultValAmort20;
			String MostraRes20 = Double.toString(ResultValRes20);
			MostraRes20 = MostraRes20.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18 + ResJuros19;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19
					+ ResultValAmort20;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 21) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText(" " + MostraRes19);
			layout2.addView(ValRes);

			double ResJuros19 = ResultValRes19 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros19 = Double.toString(ResJuros18);
			MostraJuros19 = MostraJuros19.substring(0, 5);
			ValJuros.setText("" + MostraJuros19);
			layout4.addView(ValJuros);

			double ResultValAmort20 = pmt - ResJuros19;
			String MostraAmort20 = Double.toString(ResultValAmort20);
			MostraAmort20 = MostraAmort20.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort20);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes20 = ResultValRes19 - ResultValAmort20;
			String MostraRes20 = Double.toString(ResultValRes20);
			MostraRes20 = MostraRes20.substring(0, 8);
			ValRes.setText(" " + MostraRes20);
			layout2.addView(ValRes);

			double ResJuros20 = ResultValRes20 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros20 = Double.toString(ResJuros19);
			MostraJuros20 = MostraJuros20.substring(0, 5);
			ValJuros.setText("" + MostraJuros20);
			layout4.addView(ValJuros);

			double ResultValAmort21 = pmt - ResJuros20;
			String MostraAmort21 = Double.toString(ResultValAmort21);
			MostraAmort21 = MostraAmort21.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort21);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes21 = ResultValRes20 - ResultValAmort21;
			String MostraRes21 = Double.toString(ResultValRes21);
			MostraRes21 = MostraRes21.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18 + ResJuros19
					+ ResJuros20;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19
					+ ResultValAmort20 + ResultValAmort21;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);


			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 22) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText(" " + MostraRes19);
			layout2.addView(ValRes);

			double ResJuros19 = ResultValRes19 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros19 = Double.toString(ResJuros18);
			MostraJuros19 = MostraJuros19.substring(0, 5);
			ValJuros.setText("" + MostraJuros19);
			layout4.addView(ValJuros);

			double ResultValAmort20 = pmt - ResJuros19;
			String MostraAmort20 = Double.toString(ResultValAmort20);
			MostraAmort20 = MostraAmort20.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort20);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes20 = ResultValRes19 - ResultValAmort20;
			String MostraRes20 = Double.toString(ResultValRes20);
			MostraRes20 = MostraRes20.substring(0, 8);
			ValRes.setText(" " + MostraRes20);
			layout2.addView(ValRes);

			double ResJuros20 = ResultValRes20 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros20 = Double.toString(ResJuros19);
			MostraJuros20 = MostraJuros20.substring(0, 5);
			ValJuros.setText("" + MostraJuros20);
			layout4.addView(ValJuros);

			double ResultValAmort21 = pmt - ResJuros20;
			String MostraAmort21 = Double.toString(ResultValAmort21);
			MostraAmort21 = MostraAmort21.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText("0,00");
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes21 = ResultValRes20 - ResultValAmort21;
			String MostraRes21 = Double.toString(ResultValRes21);
			MostraRes21 = MostraRes21.substring(0, 8);
			ValRes.setText(" " + MostraRes21);
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18 + ResJuros19
					+ ResJuros20;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19
					+ ResultValAmort20 + ResultValAmort21;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 23) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText(" " + MostraRes19);
			layout2.addView(ValRes);

			double ResJuros19 = ResultValRes19 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros19 = Double.toString(ResJuros18);
			MostraJuros19 = MostraJuros19.substring(0, 5);
			ValJuros.setText("" + MostraJuros19);
			layout4.addView(ValJuros);

			double ResultValAmort20 = pmt - ResJuros19;
			String MostraAmort20 = Double.toString(ResultValAmort20);
			MostraAmort20 = MostraAmort20.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort20);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes20 = ResultValRes19 - ResultValAmort20;
			String MostraRes20 = Double.toString(ResultValRes20);
			MostraRes20 = MostraRes20.substring(0, 8);
			ValRes.setText(" " + MostraRes20);
			layout2.addView(ValRes);

			double ResJuros20 = ResultValRes20 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros20 = Double.toString(ResJuros19);
			MostraJuros20 = MostraJuros20.substring(0, 5);
			ValJuros.setText("" + MostraJuros20);
			layout4.addView(ValJuros);

			double ResultValAmort21 = pmt - ResJuros20;
			String MostraAmort21 = Double.toString(ResultValAmort21);
			MostraAmort21 = MostraAmort21.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort21);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes21 = ResultValRes20 - ResultValAmort21;
			String MostraRes21 = Double.toString(ResultValRes21);
			MostraRes21 = MostraRes21.substring(0, 8);
			ValRes.setText(" " + MostraRes21);
			layout2.addView(ValRes);

			double ResJuros21 = ResultValRes21 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros21 = Double.toString(ResJuros20);
			MostraJuros21 = MostraJuros21.substring(0, 5);
			ValJuros.setText("" + MostraJuros21);
			layout4.addView(ValJuros);

			double ResultValAmort22 = pmt - ResJuros21;
			String MostraAmort22 = Double.toString(ResultValAmort22);
			MostraAmort22 = MostraAmort22.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort22);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes22 = ResultValRes21 - ResultValAmort22;
			String MostraRes22 = Double.toString(ResultValRes22);
			MostraRes22 = MostraRes22.substring(0, 8);
			ValRes.setText("  0,00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18 + ResJuros19
					+ ResJuros20 + ResJuros21;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19
					+ ResultValAmort20 + ResultValAmort21 + ResultValAmort22;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			

			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);

			setContentView(scroll);

		}

		if (nm == 24) {

			ValJuros = new TextView(this);
			ValJuros.setText("" + Icompleto);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double ResultValAmort = pmt - icompleto;
			String MostraAmort = Double.toString(ResultValAmort);
			MostraAmort = MostraAmort.substring(0, 8);
			ValAmort.setText(" " + MostraAmort);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes = vp - ResultValAmort;
			String MostraRes = Double.toString(ResultValRes);
			MostraRes = MostraRes.substring(0, 8);
			ValRes.setText(" " + MostraRes);
			layout2.addView(ValRes);

			double ResJuros = ResultValRes * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros = Double.toString(ResJuros);
			MostraJuros = MostraJuros.substring(0, 5);
			ValJuros.setText("" + MostraJuros);
			layout4.addView(ValJuros);

			double ResultValAmort1 = pmt - ResJuros;
			String MostraAmort1 = Double.toString(ResultValAmort1);
			MostraAmort1 = MostraAmort1.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort1);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes1 = ResultValRes - ResultValAmort1;
			String MostraRes1 = Double.toString(ResultValRes1);
			MostraRes1 = MostraRes1.substring(0, 8);
			ValRes.setText(" " + MostraRes1);
			layout2.addView(ValRes);

			double ResJuros1 = ResultValRes1 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros1 = Double.toString(ResJuros1);
			MostraJuros1 = MostraJuros1.substring(0, 5);
			ValJuros.setText("" + MostraJuros1);
			layout4.addView(ValJuros);

			double ResultValAmort2 = pmt - ResJuros1;
			String MostraAmort2 = Double.toString(ResultValAmort2);
			MostraAmort2 = MostraAmort2.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort2);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes2 = ResultValRes1 - ResultValAmort2;
			String MostraRes2 = Double.toString(ResultValRes2);
			MostraRes2 = MostraRes2.substring(0, 8);
			ValRes.setText(" " + MostraRes2);
			layout2.addView(ValRes);

			double ResJuros2 = ResultValRes2 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros2 = Double.toString(ResJuros2);
			MostraJuros2 = MostraJuros2.substring(0, 5);
			ValJuros.setText("" + MostraJuros2);
			layout4.addView(ValJuros);

			double ResultValAmort3 = pmt - ResJuros2;
			String MostraAmort3 = Double.toString(ResultValAmort3);
			MostraAmort3 = MostraAmort3.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort3);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes3 = ResultValRes2 - ResultValAmort3;
			String MostraRes3 = Double.toString(ResultValRes3);
			MostraRes3 = MostraRes3.substring(0, 8);
			ValRes.setText(" " + MostraRes3);
			layout2.addView(ValRes);

			double ResJuros3 = ResultValRes3 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros3 = Double.toString(ResJuros2);
			MostraJuros3 = MostraJuros3.substring(0, 5);
			ValJuros.setText("" + MostraJuros3);
			layout4.addView(ValJuros);

			double ResultValAmort4 = pmt - ResJuros3;
			String MostraAmort4 = Double.toString(ResultValAmort4);
			MostraAmort4 = MostraAmort4.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort4);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes4 = ResultValRes3 - ResultValAmort4;
			String MostraRes4 = Double.toString(ResultValRes4);
			MostraRes4 = MostraRes4.substring(0, 8);
			ValRes.setText(" " + MostraRes4);
			layout2.addView(ValRes);

			double ResJuros4 = ResultValRes4 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros4 = Double.toString(ResJuros3);
			MostraJuros4 = MostraJuros4.substring(0, 5);
			ValJuros.setText("" + MostraJuros4);
			layout4.addView(ValJuros);

			double ResultValAmort5 = pmt - ResJuros4;
			String MostraAmort5 = Double.toString(ResultValAmort5);
			MostraAmort5 = MostraAmort5.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort5);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes5 = ResultValRes4 - ResultValAmort5;
			String MostraRes5 = Double.toString(ResultValRes5);
			MostraRes5 = MostraRes5.substring(0, 8);
			ValRes.setText(" " + MostraRes5);
			layout2.addView(ValRes);

			double ResJuros5 = ResultValRes5 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros5 = Double.toString(ResJuros4);
			MostraJuros5 = MostraJuros5.substring(0, 5);
			ValJuros.setText("" + MostraJuros5);
			layout4.addView(ValJuros);

			double ResultValAmort6 = pmt - ResJuros5;
			String MostraAmort6 = Double.toString(ResultValAmort6);
			MostraAmort6 = MostraAmort6.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort6);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes6 = ResultValRes5 - ResultValAmort6;
			String MostraRes6 = Double.toString(ResultValRes6);
			MostraRes6 = MostraRes6.substring(0, 8);
			ValRes.setText(" " + MostraRes6);
			layout2.addView(ValRes);

			double ResJuros6 = ResultValRes6 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros6 = Double.toString(ResJuros5);
			MostraJuros6 = MostraJuros6.substring(0, 5);
			ValJuros.setText("" + MostraJuros6);
			layout4.addView(ValJuros);

			double ResultValAmort7 = pmt - ResJuros6;
			String MostraAmort7 = Double.toString(ResultValAmort7);
			MostraAmort7 = MostraAmort7.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort7);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes7 = ResultValRes6 - ResultValAmort7;
			String MostraRes7 = Double.toString(ResultValRes7);
			MostraRes7 = MostraRes7.substring(0, 8);
			ValRes.setText(" " + MostraRes7);
			layout2.addView(ValRes);

			double ResJuros7 = ResultValRes7 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros7 = Double.toString(ResJuros6);
			MostraJuros7 = MostraJuros7.substring(0, 5);
			ValJuros.setText("" + MostraJuros7);
			layout4.addView(ValJuros);

			double ResultValAmort8 = pmt - ResJuros7;
			String MostraAmort8 = Double.toString(ResultValAmort8);
			MostraAmort8 = MostraAmort8.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort8);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes8 = ResultValRes7 - ResultValAmort8;
			String MostraRes8 = Double.toString(ResultValRes8);
			MostraRes8 = MostraRes8.substring(0, 8);
			ValRes.setText(" " + MostraRes8);
			layout2.addView(ValRes);

			double ResJuros8 = ResultValRes8 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros8 = Double.toString(ResJuros7);
			MostraJuros8 = MostraJuros8.substring(0, 5);
			ValJuros.setText("" + MostraJuros8);
			layout4.addView(ValJuros);

			double ResultValAmort9 = pmt - ResJuros8;
			String MostraAmort9 = Double.toString(ResultValAmort9);
			MostraAmort9 = MostraAmort9.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort9);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes9 = ResultValRes8 - ResultValAmort9;
			String MostraRes9 = Double.toString(ResultValRes9);
			MostraRes9 = MostraRes9.substring(0, 8);
			ValRes.setText(" " + MostraRes9);
			layout2.addView(ValRes);

			double ResJuros9 = ResultValRes9 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros9 = Double.toString(ResJuros8);
			MostraJuros9 = MostraJuros9.substring(0, 5);
			ValJuros.setText("" + MostraJuros9);
			layout4.addView(ValJuros);

			double ResultValAmort10 = pmt - ResJuros9;
			String MostraAmort10 = Double.toString(ResultValAmort10);
			MostraAmort10 = MostraAmort10.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort10);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes10 = ResultValRes9 - ResultValAmort10;
			String MostraRes10 = Double.toString(ResultValRes10);
			MostraRes10 = MostraRes10.substring(0, 8);
			ValRes.setText(" " + MostraRes10);
			layout2.addView(ValRes);

			double ResJuros10 = ResultValRes10 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros10 = Double.toString(ResJuros9);
			MostraJuros10 = MostraJuros10.substring(0, 5);
			ValJuros.setText("" + MostraJuros10);
			layout4.addView(ValJuros);

			double ResultValAmort11 = pmt - ResJuros10;
			String MostraAmort11 = Double.toString(ResultValAmort11);
			MostraAmort11 = MostraAmort11.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort11);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes11 = ResultValRes10 - ResultValAmort11;
			String MostraRes11 = Double.toString(ResultValRes11);
			MostraRes11 = MostraRes11.substring(0, 8);
			ValRes.setText(" " + MostraRes11);
			layout2.addView(ValRes);

			double ResJuros11 = ResultValRes11 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros11 = Double.toString(ResJuros10);
			MostraJuros11 = MostraJuros11.substring(0, 5);
			ValJuros.setText("" + MostraJuros11);
			layout4.addView(ValJuros);

			double ResultValAmort12 = pmt - ResJuros11;
			String MostraAmort12 = Double.toString(ResultValAmort12);
			MostraAmort12 = MostraAmort12.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort12);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes12 = ResultValRes11 - ResultValAmort12;
			String MostraRes12 = Double.toString(ResultValRes12);
			MostraRes12 = MostraRes12.substring(0, 8);
			ValRes.setText(" " + MostraRes12);
			layout2.addView(ValRes);

			double ResJuros12 = ResultValRes12 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros12 = Double.toString(ResJuros11);
			MostraJuros12 = MostraJuros12.substring(0, 5);
			ValJuros.setText("" + MostraJuros12);
			layout4.addView(ValJuros);

			double ResultValAmort13 = pmt - ResJuros12;
			String MostraAmort13 = Double.toString(ResultValAmort13);
			MostraAmort13 = MostraAmort13.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort13);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes13 = ResultValRes12 - ResultValAmort13;
			String MostraRes13 = Double.toString(ResultValRes13);
			MostraRes13 = MostraRes13.substring(0, 8);
			ValRes.setText(" " + MostraRes13);
			layout2.addView(ValRes);

			double ResJuros13 = ResultValRes13 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros13 = Double.toString(ResJuros12);
			MostraJuros13 = MostraJuros13.substring(0, 5);
			ValJuros.setText("" + MostraJuros13);
			layout4.addView(ValJuros);

			double ResultValAmort14 = pmt - ResJuros13;
			String MostraAmort14 = Double.toString(ResultValAmort14);
			MostraAmort14 = MostraAmort14.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort14);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes14 = ResultValRes13 - ResultValAmort14;
			String MostraRes14 = Double.toString(ResultValRes14);
			MostraRes14 = MostraRes14.substring(0, 8);
			ValRes.setText(" " + MostraRes14);
			layout2.addView(ValRes);

			double ResJuros14 = ResultValRes14 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros14 = Double.toString(ResJuros13);
			MostraJuros14 = MostraJuros14.substring(0, 5);
			ValJuros.setText("" + MostraJuros14);
			layout4.addView(ValJuros);

			double ResultValAmort15 = pmt - ResJuros14;
			String MostraAmort15 = Double.toString(ResultValAmort15);
			MostraAmort15 = MostraAmort15.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort15);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes15 = ResultValRes14 - ResultValAmort15;
			String MostraRes15 = Double.toString(ResultValRes15);
			MostraRes15 = MostraRes15.substring(0, 8);
			ValRes.setText(" " + MostraRes15);
			layout2.addView(ValRes);

			double ResJuros15 = ResultValRes15 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros15 = Double.toString(ResJuros14);
			MostraJuros15 = MostraJuros15.substring(0, 5);
			ValJuros.setText("" + MostraJuros15);
			layout4.addView(ValJuros);

			double ResultValAmort16 = pmt - ResJuros15;
			String MostraAmort16 = Double.toString(ResultValAmort16);
			MostraAmort16 = MostraAmort16.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort16);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes16 = ResultValRes15 - ResultValAmort16;
			String MostraRes16 = Double.toString(ResultValRes16);
			MostraRes16 = MostraRes16.substring(0, 8);
			ValRes.setText(" " + MostraRes16);
			layout2.addView(ValRes);

			double ResJuros16 = ResultValRes16 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros16 = Double.toString(ResJuros15);
			MostraJuros16 = MostraJuros16.substring(0, 5);
			ValJuros.setText("" + MostraJuros16);
			layout4.addView(ValJuros);

			double ResultValAmort17 = pmt - ResJuros16;
			String MostraAmort17 = Double.toString(ResultValAmort17);
			MostraAmort17 = MostraAmort17.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort17);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes17 = ResultValRes16 - ResultValAmort17;
			String MostraRes17 = Double.toString(ResultValRes17);
			MostraRes17 = MostraRes17.substring(0, 8);
			ValRes.setText(" " + MostraRes17);
			layout2.addView(ValRes);

			double ResJuros17 = ResultValRes17 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros17 = Double.toString(ResJuros16);
			MostraJuros17 = MostraJuros17.substring(0, 5);
			ValJuros.setText("" + MostraJuros17);
			layout4.addView(ValJuros);

			double ResultValAmort18 = pmt - ResJuros17;
			String MostraAmort18 = Double.toString(ResultValAmort18);
			MostraAmort18 = MostraAmort18.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort18);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes18 = ResultValRes17 - ResultValAmort18;
			String MostraRes18 = Double.toString(ResultValRes18);
			MostraRes18 = MostraRes18.substring(0, 8);
			ValRes.setText(" " + MostraRes18);
			layout2.addView(ValRes);

			double ResJuros18 = ResultValRes18 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros18 = Double.toString(ResJuros17);
			MostraJuros18 = MostraJuros18.substring(0, 5);
			ValJuros.setText("" + MostraJuros18);
			layout4.addView(ValJuros);

			double ResultValAmort19 = pmt - ResJuros18;
			String MostraAmort19 = Double.toString(ResultValAmort19);
			MostraAmort19 = MostraAmort19.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort19);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes19 = ResultValRes18 - ResultValAmort19;
			String MostraRes19 = Double.toString(ResultValRes19);
			MostraRes19 = MostraRes19.substring(0, 8);
			ValRes.setText(" " + MostraRes19);
			layout2.addView(ValRes);

			double ResJuros19 = ResultValRes19 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros19 = Double.toString(ResJuros18);
			MostraJuros19 = MostraJuros19.substring(0, 5);
			ValJuros.setText("" + MostraJuros19);
			layout4.addView(ValJuros);

			double ResultValAmort20 = pmt - ResJuros19;
			String MostraAmort20 = Double.toString(ResultValAmort20);
			MostraAmort20 = MostraAmort20.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort20);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes20 = ResultValRes19 - ResultValAmort20;
			String MostraRes20 = Double.toString(ResultValRes20);
			MostraRes20 = MostraRes20.substring(0, 8);
			ValRes.setText(" " + MostraRes20);
			layout2.addView(ValRes);

			double ResJuros20 = ResultValRes20 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros20 = Double.toString(ResJuros19);
			MostraJuros20 = MostraJuros20.substring(0, 5);
			ValJuros.setText("" + MostraJuros20);
			layout4.addView(ValJuros);

			double ResultValAmort21 = pmt - ResJuros20;
			String MostraAmort21 = Double.toString(ResultValAmort21);
			MostraAmort21 = MostraAmort21.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort21);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes21 = ResultValRes20 - ResultValAmort21;
			String MostraRes21 = Double.toString(ResultValRes21);
			MostraRes21 = MostraRes21.substring(0, 8);
			ValRes.setText(" " + MostraRes21);
			layout2.addView(ValRes);

			double ResJuros21 = ResultValRes21 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros21 = Double.toString(ResJuros20);
			MostraJuros21 = MostraJuros21.substring(0, 5);
			ValJuros.setText("" + MostraJuros21);
			layout4.addView(ValJuros);

			double ResultValAmort22 = pmt - ResJuros21;
			String MostraAmort22 = Double.toString(ResultValAmort22);
			MostraAmort22 = MostraAmort22.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort22);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes22 = ResultValRes21 - ResultValAmort22;
			String MostraRes22 = Double.toString(ResultValRes22);
			MostraRes22 = MostraRes22.substring(0, 8);
			ValRes.setText(" " + MostraRes22);
			layout2.addView(ValRes);

			double ResJuros22 = ResultValRes22 * taxajuros;
			ValJuros = new TextView(this);
			String MostraJuros22 = Double.toString(ResJuros21);
			MostraJuros22 = MostraJuros22.substring(0, 5);
			ValJuros.setText("" + MostraJuros22);
			layout4.addView(ValJuros);

			double ResultValAmort23 = pmt - ResJuros22;
			String MostraAmort23 = Double.toString(ResultValAmort23);
			MostraAmort23 = MostraAmort23.substring(0, 8);
			ValAmort = new TextView(this);
			ValAmort.setText(" " + MostraAmort23);
			layout3.addView(ValAmort);

			ValRes = new TextView(this);
			double ResultValRes23 = ResultValRes22 - ResultValAmort23;
			String MostraRes23 = Double.toString(ResultValRes23);
			MostraRes23 = MostraRes23.substring(0, 8);
			ValRes.setText("0.00");
			layout2.addView(ValRes);

			ValJuros = new TextView(this);
			double SomaJuros = icompleto + ResJuros + ResJuros1 + ResJuros2
					+ ResJuros3 + ResJuros4 + ResJuros5 + ResJuros6 + ResJuros7
					+ ResJuros8 + ResJuros9 + ResJuros10 + ResJuros11
					+ ResJuros12 + ResJuros13 + ResJuros14 + ResJuros15
					+ ResJuros16 + ResJuros17 + ResJuros18 + ResJuros19
					+ ResJuros20 + ResJuros21 + ResJuros22;
			String TotalJuros = Double.toString(SomaJuros);
			TotalJuros = TotalJuros.substring(0, 5);
			ValJuros.setText("" + TotalJuros);
			layout4.addView(ValJuros);

			ValAmort = new TextView(this);
			double Somaamortizacao = ResultValAmort + ResultValAmort1
					+ ResultValAmort2 + ResultValAmort3 + ResultValAmort4
					+ ResultValAmort5 + ResultValAmort6 + ResultValAmort7
					+ ResultValAmort8 + ResultValAmort9 + ResultValAmort10
					+ ResultValAmort11 + ResultValAmort12 + ResultValAmort13
					+ ResultValAmort14 + ResultValAmort15 + ResultValAmort16
					+ ResultValAmort17 + ResultValAmort18 + ResultValAmort19
					+ ResultValAmort20 + ResultValAmort21 + ResultValAmort22
					+ ResultValAmort23;
			String TotalAmortizacao = Double.toString(Somaamortizacao);
			TotalAmortizacao = TotalAmortizacao.substring(0, 8);
			ValAmort.setText(" " + TotalAmortizacao);
			layout3.addView(ValAmort);

			
			layout.addView(layout1);
			layout.addView(layout2);
			layout.addView(layout3);
			layout.addView(layout4);
			layout.addView(layout5);
			setContentView(scroll);
		}

	}

}